Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(torii-core): bitflags for indexing #2450

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Conversation

Larkooo
Copy link
Collaborator

@Larkooo Larkooo commented Sep 19, 2024

Summary by CodeRabbit

  • New Features

    • Introduced command-line arguments for users to control indexing of transactions and raw events.
    • Added a new IndexingFlags structure for improved configuration of indexing options.
  • Improvements

    • Enhanced performance by allowing conditional processing of transactions and events based on specified flags.
  • Dependencies

    • Added support for command-line argument parsing and flag management with new dependencies: clap and bitflags.

Copy link

coderabbitai bot commented Sep 19, 2024

Walkthrough

Ohayo, sensei! The changes introduce new command-line arguments for indexing transactions and raw events in the application. Two boolean flags, index_transactions and index_raw_events, have been added to the Args struct, with default values set to false and true, respectively. A new IndexingFlags struct has been created to manage these settings within the EngineConfig. Additionally, the Cargo.toml file has been updated to include dependencies for clap and bitflags, enhancing command-line argument parsing and flag management.

Changes

File Path Change Summary
bin/torii/src/main.rs Added index_transactions and index_raw_events boolean flags to Args struct.
crates/torii/core/Cargo.toml Added dependencies: clap (workspace) and bitflags = "2.6.0".
crates/torii/core/src/engine.rs Introduced IndexingFlags struct; modified EngineConfig to include flags; updated processing methods for transactions and events to utilize the new flags.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Engine
    participant RPC

    User->>CLI: Execute application with flags
    CLI->>Engine: Pass indexing flags
    Engine->>RPC: Fetch transactions (if index_transactions is true)
    Engine->>RPC: Fetch events (if index_raw_events is true)
    Engine-->>User: Return results
Loading

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7b54e38 and cc6c6b3.

Files selected for processing (1)
  • bin/torii/src/main.rs (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • bin/torii/src/main.rs

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 55 lines in your changes missing coverage. Please review.

Project coverage is 68.29%. Comparing base (5777c00) to head (cc6c6b3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/torii/core/src/engine.rs 21.15% 41 Missing ⚠️
bin/torii/src/main.rs 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2450      +/-   ##
==========================================
- Coverage   68.37%   68.29%   -0.08%     
==========================================
  Files         365      365              
  Lines       47973    48034      +61     
==========================================
+ Hits        32801    32805       +4     
- Misses      15172    15229      +57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have this configurable.

Indexing events by default nice, should we expose back then using graphQL and gRPC?

@glihm glihm merged commit 82a23a5 into dojoengine:main Sep 19, 2024
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants